package cn.itsource.controller.app;

import cn.dev33.satoken.annotation.SaIgnore;
import cn.itsource.pojo.dto.WxRegisterDTO;
import cn.itsource.result.JSONResult;
import cn.itsource.service.ICustomerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Tag(name = "乘客对象",description = "乘客对象")
@RestController
@RequestMapping("/app/customer")
public class AppCustomerController {

    @Autowired
    public ICustomerService customerService;

    @Operation( summary= "微信注册",description = "微信注册")
    @Parameter(name = "customer",description = "保存的对象",required = true)
    @PostMapping("/wxRegister")
    @SaIgnore
    public JSONResult wxRegister(@RequestBody @Valid WxRegisterDTO dto){
        customerService.wxRegister(dto);
        return JSONResult.success();
    }


}
